package com.gameShare.utils.ffmpeg

import com.gameShare.utils.StringUtils
import org.springframework.stereotype.Component

@Component
class FfmpegUtils(val cmdExecutor: CmdExecutor) : IFfmpegCmd{

    override fun compressionImage(srcPath: String, targetPath: String, level : Int?): Pair<String, String> {
        StringUtils.checkPathIsOk(srcPath)
        StringUtils.checkPathIsOk(targetPath)
        return cmdExecutor.executeCmd("ffmpeg -i $srcPath -q:v $level $targetPath -y")
    }
}